UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1YrSFbMlWYFl1UBaXMX0t+QoF1dSvri1TM68Ziu8gGY=' 
WHERE 
  key_id = '8c5831cae303ca7d58dcbeccbb43966e272a7b73f7f5bd95100222b7559ba85f' 
  AND (
    token = '1YrSFbMlWYFl1UBaXMX0t+QoF1dSvri1TM68Ziu8gGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026