UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8E26KcIOODamw5OwKRWcA+eVCxfoo9OFXxquoLe5MeU=' 
WHERE 
  key_id = '07ebea7d5657050ab3b0830b959ba8a9560f0fcaac1dc87f871f52bb1431fde6' 
  AND (
    token = '8E26KcIOODamw5OwKRWcA+eVCxfoo9OFXxquoLe5MeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021