UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QG6kyb12Ro5a1lsp03IRbFvltSNmmAvr8OcTUqxqkXU=' 
WHERE 
  key_id = '629672eb329bf34c1defb9ba9849e1bdb42caaae48204a1de603ca18148cc584' 
  AND (
    token = 'QG6kyb12Ro5a1lsp03IRbFvltSNmmAvr8OcTUqxqkXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026