UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JjHfRH7W1+w6pRyXI5h42IbTDPv9pgyCr/8FS/hfoA=' 
WHERE 
  key_id = '734c13f0603d7778c0c67d33dcfcd66e5252250109736fd65fe7a0f7895120b2' 
  AND (
    token = '5JjHfRH7W1+w6pRyXI5h42IbTDPv9pgyCr/8FS/hfoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048