UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ttKLAkVmRPkqFG1I5+yr2YJbcM3a5NLLKCKVzY2250=' 
WHERE 
  key_id = '786b0545a3c375fd8a0ab2eaff7a9f19cc5f8a20927db491e3bcd6bdb5bd3160' 
  AND (
    token = '2ttKLAkVmRPkqFG1I5+yr2YJbcM3a5NLLKCKVzY2250=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037