UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hrk/PLwyCu3rTFqax8OBKWOrvNLBFAAVgppM15mzMzE=' 
WHERE 
  key_id = 'a19bf9b94fa6d94455498cd43fd50d4cb1e6db2255bf68f4836773c0c2c6d67c' 
  AND (
    token = 'hrk/PLwyCu3rTFqax8OBKWOrvNLBFAAVgppM15mzMzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029