UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mVC+SU8dfdfFBY5G3F8Vtv7uOb/rz7wTaAJfY1FjzGo=' 
WHERE 
  key_id = '5b2455b95d4c0220684a8d384db72ad3a8c9518cd7cc3353f97de43b31f39abe' 
  AND (
    token = 'mVC+SU8dfdfFBY5G3F8Vtv7uOb/rz7wTaAJfY1FjzGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057