UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+aBA/iXDMwT7Zh/8bzeYPyV/EnhZM7GSQBoq340KyOU=' 
WHERE 
  key_id = '459711fc0773f250648fb9a65d720bab8ec4c6aeb07469ef19a7b6ff7ee092e4' 
  AND (
    token = '+aBA/iXDMwT7Zh/8bzeYPyV/EnhZM7GSQBoq340KyOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018