UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TCG5n/x9zJstREdbC9xWQQQyn0Pr70e++UNxovQukxk=' 
WHERE 
  key_id = 'c23422d369b65a27dbb104c8e28631fcc915cca964f03f5663888dc935055bd7' 
  AND (
    token = 'TCG5n/x9zJstREdbC9xWQQQyn0Pr70e++UNxovQukxk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033