UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T9qh1D9umwI8qs5uDXnOa6ElpXAAtSG2Hqa3UtTnSoI=' 
WHERE 
  key_id = '6156c7a4c57f4faae2af8ba2bbbef9b9c4825c050b7fa18f2287e3876c4c9f9b' 
  AND (
    token = 'T9qh1D9umwI8qs5uDXnOa6ElpXAAtSG2Hqa3UtTnSoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030