UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SHx/q6hypnmnR/I9uNcrkZXrL/5YmyeqaHYjHs9WzaE=' 
WHERE 
  key_id = '6593a2138c3dec61f9b9b4f8f21946b5e4b0fa7ddf7c61f5f23bd2c9f3316e4d' 
  AND (
    token = 'SHx/q6hypnmnR/I9uNcrkZXrL/5YmyeqaHYjHs9WzaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027