UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LS3S9vHb2qQ0D7n6WCJv+E4chYcvvC9EviOX7jz5wYY=' 
WHERE 
  key_id = '944272d6cbd6aac0ea019a517578d44ad7118f39024d81e284cdd9ec1663248a' 
  AND (
    token = 'LS3S9vHb2qQ0D7n6WCJv+E4chYcvvC9EviOX7jz5wYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031