UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F+S6UBKCCEKOvgiZUJZjmJmkmqKAwUc+rD+AA9u/ILQ=' 
WHERE 
  key_id = 'a2e65967b236f64bd849fa79caf17d64af2d474b5f7fc6ea0ded3208ead9510b' 
  AND (
    token = 'F+S6UBKCCEKOvgiZUJZjmJmkmqKAwUc+rD+AA9u/ILQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025