UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eK/nIB00a/nc+Ln2Kyod6VtqmjfjVUiJ6aJxdF6G21U=' 
WHERE 
  key_id = 'a94e66092d6b6f81097aa5b3796993c34bc51092e6dc9622cb97ba3465552cbc' 
  AND (
    token = 'eK/nIB00a/nc+Ln2Kyod6VtqmjfjVUiJ6aJxdF6G21U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032