UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kB7AJJlS30o8xDkAE5Fpd3ApZLC0vGZ8WJvCs26oFug=' 
WHERE 
  key_id = 'e0076067fe5e86cda7193db2e15bcd79147fbfa01ad79209247e765461b3264a' 
  AND (
    token = 'kB7AJJlS30o8xDkAE5Fpd3ApZLC0vGZ8WJvCs26oFug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034