UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cg0L63LQXTapdXm1s5Nqsf1LKVq1DcVIhJ3hzjAyBnQ=' 
WHERE 
  key_id = '92c01e8a0802452f38482ca3c07f89982938b31508c18d3c872d49f25041ac73' 
  AND (
    token = 'Cg0L63LQXTapdXm1s5Nqsf1LKVq1DcVIhJ3hzjAyBnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00089