UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dgm/NUC9TXgqBsIJFpuq6QfiR5rs4ygOpv0Up4LgUG8=' 
WHERE 
  key_id = 'e2efaaf8afb92ccb16ea836c488c93b2ac54352b668a4915db62718e03b0edd5' 
  AND (
    token = 'Dgm/NUC9TXgqBsIJFpuq6QfiR5rs4ygOpv0Up4LgUG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049