UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7dnYKCk+2E6kBPLq6PCaQsdRnG/rrkg6udu421FMJvM=' 
WHERE 
  key_id = 'ac25b361bbb0ce549124fabdd1b223ab9b847c077688826f6671e3955dd14ff7' 
  AND (
    token = '7dnYKCk+2E6kBPLq6PCaQsdRnG/rrkg6udu421FMJvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049