UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+fofr68Un02rJ6vtugSC4GqauNoBlf2QrIROcHHTAgA=' 
WHERE 
  key_id = '7d0e0009906ecf06a3ab2eff9b1006c259a42f9761086dbe07de3ff56a6a3c00' 
  AND (
    token = '+fofr68Un02rJ6vtugSC4GqauNoBlf2QrIROcHHTAgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040