UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vwbsxbS8iL0NB8NBvEHSIbSR3UWndajQv2jh1zwUDa0=' 
WHERE 
  key_id = '7a3a030763933f6c90cce29662628f7237db29baa5b9624581084629a37e0d99' 
  AND (
    token = 'vwbsxbS8iL0NB8NBvEHSIbSR3UWndajQv2jh1zwUDa0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017