UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6P1qtBKx+e88Fqj3MU+MKJ2tJIgR0UXm4wyCmBQ8xWo=' 
WHERE 
  key_id = '9ee5e3d3f1347e9e872148f237ea290fc6001441ecde9513a4c4d29c4ee29e39' 
  AND (
    token = '6P1qtBKx+e88Fqj3MU+MKJ2tJIgR0UXm4wyCmBQ8xWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022