UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bzHQqgSNWa3Y0P5oCQFARKU9qRirnj5gHz9D1hIkFVo=' 
WHERE 
  key_id = '993bb3da621ef7498be2813410c4fd59ffd29a09574b48a407fbcd9aeb87c638' 
  AND (
    token = 'bzHQqgSNWa3Y0P5oCQFARKU9qRirnj5gHz9D1hIkFVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017