UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DhPmp0/zXa5m8K8lg0T62le+bmOqYZghrF+tyZSsbf0=' 
WHERE 
  key_id = '6d5c14e9a28082826915ce278c7f81665d71d5064b03fc073959fe1382b552d5' 
  AND (
    token = 'DhPmp0/zXa5m8K8lg0T62le+bmOqYZghrF+tyZSsbf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032