UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E5A7Rev8+dlYK4E9UaYbo1mb3hhhT0jWZEQsw+K2V7A=' 
WHERE 
  key_id = '81793bedd5b7cdf5fcf8b9aa7648c8bb82f3fc794b508a72e3a78920a518970c' 
  AND (
    token = 'E5A7Rev8+dlYK4E9UaYbo1mb3hhhT0jWZEQsw+K2V7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032