UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MRlW75S4Yu35LsS27qSnds0AFCXP/E3o2MnrMyAnLF8=' 
WHERE 
  key_id = 'd25c584c068f8250ec8b557080bc71e4ac71fb4cc9a1282264f4182f22fcca67' 
  AND (
    token = 'MRlW75S4Yu35LsS27qSnds0AFCXP/E3o2MnrMyAnLF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017