UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z7+YS0rsbRE4bPYORJRB1itl1L6bUfF6vYMTdlTr4bs=' 
WHERE 
  key_id = '5aeeeb227dfe87cbd3c4e96435085c9679e89ea4b33f059e054e2b78ac07ad9a' 
  AND (
    token = 'Z7+YS0rsbRE4bPYORJRB1itl1L6bUfF6vYMTdlTr4bs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057