UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1z2wc7x2tzpzxLuWD+NN+UPuD7ieYbOSKV3vEpjhbiE=' 
WHERE 
  key_id = 'db626648b586810dbbf464f70a3f1e39a6b2779834ba1f86aa3f841307570554' 
  AND (
    token = '1z2wc7x2tzpzxLuWD+NN+UPuD7ieYbOSKV3vEpjhbiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022