UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ua2CX1e/AMZmbU+DU5MLEbnfTjzz1bThC50rVa8PBCA=' 
WHERE 
  key_id = 'f7ddf089dee77896905692b7f7f33d2a9480dea7a16a5fdaaf669bf47506d944' 
  AND (
    token = 'Ua2CX1e/AMZmbU+DU5MLEbnfTjzz1bThC50rVa8PBCA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060