UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aNtxL+xAErbb1/ZtW2Y9lhb/A0jWw0Eov4pZK9uFgpw=' 
WHERE 
  key_id = '76a8daf099e558474f7710498f468cee995257a7434d388f17b10e7bd7016a08' 
  AND (
    token = 'aNtxL+xAErbb1/ZtW2Y9lhb/A0jWw0Eov4pZK9uFgpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027