UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6DCS/RE5naHffmhRekkh85Z2UUlaBgZT5Mf9iEVR9LU=' 
WHERE 
  key_id = '7c5d3b09de024188509528b4cc1d1e774ec783acb0627dd113a911f55607f786' 
  AND (
    token = '6DCS/RE5naHffmhRekkh85Z2UUlaBgZT5Mf9iEVR9LU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033